package com.atguigu.mvc.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/**
 * @date: 2021/12/13 14:30
 * @description:
 */
@Controller
@RequestMapping("/hello")
public class TestRequestMappingController {

    @RequestMapping(value={"/testRequestMapping","/test"},method = {RequestMethod.GET,RequestMethod.POST})
    public String success(){
        return "success";
    }

    @GetMapping(value={"/getmapping"})
    public String testGetMapping(){
        return "success";
    }

    @PostMapping(value={"/postmapping"})
    public String testPostMapping(){
        return "success";
    }

    @RequestMapping(value = "/testParams",
    params = {"username","password=123456"}
    )
    public String testParams(){
        return "success";
    }
    @RequestMapping(value = "/testRestFul/{id}/{username}")
    public String testRestFul(@PathVariable("id")String id,@PathVariable("username")String username){
        System.out.println("id:"+id+",username:"+username);
        return "success";
    }
}
